{include file="public/header" /}
<body>
<style>
    .cion{
        display: inline-block;
        width: 120px;
    }
</style>
<nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页
    <span class="c-gray en">&gt;</span> 商品管理
    <span class="c-gray en">&gt;</span> 预定列表
    <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="/good/order_book" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i></a>
</nav>
<div class="page-container">
    <form  method="get" action="">
        <div class="text-c">
            日期范围：
            <input type="text" onfocus="WdatePicker()" value="{:input('get.start')}" name="start" id="datemin" class="input-text Wdate" style="width:120px;" autocomplete="off">
             -
            <input type="text" onfocus="WdatePicker()" value="{:input('get.end')}" name="end" id="datemax" class="input-text Wdate" style="width:120px;" autocomplete="off">
            <input type="text" class="input-text" style="width:250px" placeholder="预定人账号" value="{:input('word')}" name="word">
            <span class="select-box" style="width: 100px;">
                <select name="status" class="select">
                    <option value="-1">全部状态</option>
                    <option value="1" {if isset($_GET['status']) && $_GET['status'] == 1}selected{/if}>未开奖</option>
                    <option value="2" {if isset($_GET['status']) && $_GET['status'] == 2}selected{/if}>中奖</option>
                    <option value="3" {if isset($_GET['status']) && $_GET['status'] == 3}selected{/if}>未中奖</option>
                    <option value="4" {if isset($_GET['status']) && $_GET['status'] == 4}selected{/if}>终止</option>
                </select>
            </span>
            <span class="select-box" style="width: 100px;">
                <select name="gid" class="select">
                    <option value="0">全部商品</option>
                    {foreach $goods as $v}
                        {if isset($_GET['gid']) && $v.id ==  $_GET['gid']}
                        <option value="{$v.id}" selected>{$v.name}</option>
                        {else/}
                        <option value="{$v.id}">{$v.name}</option>
                        {/if}
                    {/foreach}

                </select>
            </span>
            <button type="submit" class="btn btn-success">搜索</button>
        </div>
    </form>

    <div class="cl pd-5 bg-1 bk-gray mt-20">
        <span class="l">
        </span>
        <span class="r">共有数据：<strong>{$list->total()}</strong> 条</span> </div>
    <table class="table table-border table-bordered table-hover table-bg">
        <thead>
            <tr>
                <th scope="col" colspan="6">预定列表</th>
            </tr>
            <tr class="text-c">
                <th width="100">预定人账号</th>
                <th width="100">预定商品</th>
                <th width="80">中奖权重</th>
                <th width="100">预定时间</th>
                <th width="100">状态</th>
                <th width="80">操作</th>
            </tr>
        </thead>
        <tbody>
            {foreach $list as $v}
            <tr class="text-c">

                <td>{$v.username}</td>
                <td>{$v.gname}</td>
                <td>{$v.weight}</td>
                <td>{$v.create_time}</td>
                <td>{switch name="$v.status"}
                    {case value="1"}未开奖{/case}
                    {case value="2"}中奖{/case}
                    {case value="3"}未中奖
                        {if $v.gived == 1}
                            (已赠送)
                        {else /}  (未赠送)
                        {/if}</td>
                    {/case}
                    {case value="4"}终止{/case}
                    {default /}--
                    {/switch}</td>
                </td>
                <td>
                    <span class="btn btn-link" title="权重" href="javascript:;" onclick="layopen('权重','{:url('order_book_edit',['id'=>$v.id])}')">权重</span>
                </td>
            </tr>
            {/foreach}
        </tbody>
    </table>
    <div class="page">
        {$list->render()|raw}
    </div>
</div>

{include file="public/footer" /}

<script type="text/javascript">


</script>